import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Caipiao {
    public static int[] randomSelect(int total, int number) {
        int[] result = new int[number];
        List<String> list = new ArrayList<String>();
        Random r = new Random();

        for (int i = 0; i < total; i++) {
            list.add(i + 1 + "");
        }

        for (int j = 0; j < number; j++) {
            int size = list.size();
            String s = list.get(r.nextInt(size));

            result[j] = Integer.parseInt(s);
            list.remove(s);
        }
        return result;
    }

    public static void main(String[] args) {
        int[] red = randomSelect(33, 6);
        int[] blue = randomSelect(16, 1);
        System.out.println("红球是：");
        for (int i = 0; i < red.length; i++) {
            System.out.print(red[i] + "\t");
        }
        System.out.println("\n蓝球是：");
        for (int i = 0; i < blue.length; i++) {
            System.out.println(blue[i] + "\t");
        }
    }

}
